package myapps.ttclient.protocol.message;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import myapps.ttclient.GlobalVariables;
import myapps.ttclient.Helper;
import myapps.ttclient.baseclass_and_interface.TTClientMessage;


public class MouseMoveMessage extends TTClientMessage
{
	public String temporaryKey = "";
	
	public int moveX;
	public int moveY;
	
	public MouseMoveMessage(String temporaryKey, int moveX, int moveY)
	{
		this.temporaryKey = temporaryKey;
		this.moveX = moveX;
		this.moveY = moveY;
	}
	
	public static TTClientMessage parse(DataInputStream dis) throws IOException
	{
		throw new IOException("NotImplemented");
	}
	
	@Override
	public void toDataOutputStream(DataOutputStream dos) throws IOException
	{
		dos.writeByte(MOUSE_MOVE);
		dos.writeInt(GlobalVariables.NO_LENGTH_CODE);
		
		Helper.WriteStringToDataOutputStream(dos, this.temporaryKey);
		
		dos.writeShort(this.moveX);
		dos.writeShort(this.moveY);
	}
}
